<?php
namespace app\index\validate;
use app\admin\code\AdminCode;
use app\admin\code\AuthCode;
use app\admin\code\BaseCode;
use app\admin\model\AdminModel;
use app\admin\model\BaseModel;
use think\Session;
use think\Validate;

class DesignValidate extends Validate
{
    protected $rule = [
        'contacts'     =>  'require|max:20',
        'mobile'     =>  'require',
        'detail'     =>  'require|max:1024',
        'address'     =>  'require|max:1024',
        'logo'     =>  'require',
    ];
    protected $field = [
        'contacts' => '公司/个人',
        'mobile' => '手机号码',
        'detail' => '介绍',
        'address' =>'地址'
    ];
    protected  function is_mobile($data){
        $reg = '/^((13[0-9])|(14[5,7])|(15[0-3,5-9])|(17[0,3,5-8])|(18[0-9])|166|198|199|(147))\\d{8}$/';
        if(preg_match($reg,$data)){
            return true;
        }else{
            return false;
        }
    }
}


